package Chapter01;
import java.util.Scanner;
public class CarTest {
    public static void main(String[] args) {
        Car car=new Car();
        Scanner input =new Scanner(System.in);
        System.out.println("请输入汽车的外观:");
        car.appearance=input.next();
        System.out.println("请输入汽车的价格:");
        car.price=input.nextDouble();
        System.out.println("请输入汽车的油耗:");
        car.consumption=input.nextInt();
        System.out.println("是否启动车子?('y')");
        String start=input.next();
        if (start.equals("y")){
            car.start();
        }
        System.out.println("是否停止车子?('y')");
        String stop =input.next();
        if (stop.equals("y")){
            car.stop();
        }else{
            System.out.println("是否要鸣笛?('y')");
            String whistle=input.next();
            if (whistle.equals("y")){
                car.whistle();
            }
        }
    }
}
